/*
 * Created on 03/06/2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package br.ufal.tci.nexos.arcolive.gui;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 * @author Marcio
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class ConnectionConfigurations extends JInternalFrame {
	
	private JPanel mainPanel;

	private JLabel ipLabel;
	private JPanel ipPanel1;
	private JPanel ipPanel2;
	private JTextField ipTextField;

	private JLabel portLabel;
	private JPanel portPanel1;
	private JPanel portPanel2;
	private JTextField portTextField;

	private JButton okButton;
	
	public ConnectionConfigurations() {
		initComponents();
	}

	public void initComponents() {

		mainPanel = new JPanel();
		//ipLabel = new JLabel("IP da Conex?o: ");
		ipLabel = new JLabel("Connection IP: ");
		ipPanel1 = new JPanel();
		ipTextField = new JTextField();
		ipPanel2 = new JPanel();
		//portLabel = new JLabel("Porta de Conex?o: ");
		portLabel = new JLabel("Connection Port: ");
		portPanel1 = new JPanel();
		portTextField = new JTextField();
		portPanel2 = new JPanel();
		okButton = new JButton(" OK ");
		
		getContentPane().setLayout(new FlowLayout());
		
		setIconifiable(true);
		setClosable(true);
        //setTitle("Configura??es de Conex?o");
		setTitle("Connection Configurations");
        
        ipTextField.setPreferredSize(new Dimension(150, 22));
        portTextField.setPreferredSize(new Dimension(150, 22));
        
        ipTextField.setText("192.168.0.9");
        portTextField.setText("80");
        
        ipPanel1.setLayout(new BorderLayout());
        ipPanel1.add(ipLabel, BorderLayout.PAGE_END);
        ipPanel2.setLayout(new BorderLayout());
        ipPanel2.add(ipTextField, BorderLayout.PAGE_START);
        
        portPanel1.setLayout(new BorderLayout());
        portPanel1.add(portLabel, BorderLayout.PAGE_END);
        portPanel2.setLayout(new BorderLayout());
        portPanel2.add(portTextField, BorderLayout.PAGE_START);
        
		mainPanel.setLayout(new GridLayout(2, 2, 3, 3));
		
		mainPanel.add(ipPanel1);
		mainPanel.add(ipPanel2);
		mainPanel.add(portPanel1);
		mainPanel.add(portPanel2);
		
		getContentPane().add(mainPanel);
		getContentPane().add(okButton);
		
        pack();

        Desktop.getInstance().getDesktopPane().add(this);
		setSize(350, 120);
		show();
	}
	
}